<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			
			/*
			 练习：创建以下构造函数(类)

				Cat: 猫
				属性：fur
				方法：eat; miaow
				
				GarfieldCat : 加菲猫
				属性：fur; glasses
				方法：eat; miaow; talk
				
				TomCat : 汤姆猫
				属性：fur; friend
				方法：eat; miaow; catchMouse
				
			*/
			//Cat
			function Cat(_fur){
				this.fur = _fur;
				this.eat = function(){
					console.log("eat");
				}
				this.miaow = function(){
					console.log("喵喵~");
				}
			}
			var cat = new Cat("白色的毛");
			
			//GarfieldCat
			function GarfieldCat(_fur, _glasses){
				this.fur = _fur;
				this.glasses = _glasses;
				this.eat = function(){
					console.log("eat");
				}
				this.miaow = function(){
					console.log("喵喵~");
				}
				this.talk = function(){
					console.log("说话");
				}
			}
			
			//TomCat
			function TomCat(_fur, _friend){
				this.fur = _fur;
				this.friend = _friend;
				this.eat = function(){
					console.log("eat");
				}
				this.miaow = function(){
					console.log("喵喵~");
				}
				this.catchMouse = function(){
					console.log("抓老鼠");
				}
			}
			
			
			
		</script>
	</head>
	<body>
	</body>
</html>
